// 导入定义验证规则的包
const Joi = require("joi");
// 邮箱校验规则
const email = Joi.string()
  .email()
  .required()
  .error(new Error("请填写正确的邮箱格式"));
exports.reg_users_schema = {
  body: {
    email,
  },
};
const avatar_url = Joi.number().required().error(new Error("请上传头像"));
exports.reg_updateAvatar_schema = {
  query: {
    avatar_url,
  },
};
const code = Joi.string()
  .regex(/^[0-9]{5}$/)
  .required()
  .error(new Error("请输入5位数字code码"));
exports.reg_getPlacard_schema = {
  query: {
    code,
  },
};
